﻿<%@ Page Title="" Language="C#" MasterPageFile="~/master/Site.Master" AutoEventWireup="true"
	CodeBehind="Library.aspx.cs" Inherits="Hematology.UserSite.Library" %>

<%@ Import Namespace="Hematology.Data" %>
<%@ Import Namespace="Hematology.Tools" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphHead" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphRecent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cphHeadNews" runat="server">
	<hmt:PageTitle runat="server" ID="ptTitle" Text='<%$ Resources:UserSite, resTopicLibrary %>'
		ShowButton="True" ButtonCssClass="levelUp" TitleButtonType="Hyperlink" />
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="cphBody" runat="server">
	<div class="container2">
		<div id="left-div">
			<asp:Repeater runat="server" ID="rptLibraryFull">
				<ItemTemplate>
					<div class="post-wrapper">
						<div class="post">
							<div class="homepost-left">
								<div class="thumbnailwrap">
									<asp:HyperLink ID="hlReadFull" runat="server" Text='<%$ Resources:UserSite, resReadFull %>'
										NavigateUrl='<%# string.Format("/Library.aspx?ct={0}&id={1}", ConvertToType(Eval("ContentTypeCode")), Eval("SiteContentId")) %>' />
								</div>
							</div>
							<div class="homepost-right">
								<h2 class="titles">
									<asp:HyperLink runat="server" ID="hlViewLibrary" Text='<%# Eval("Title") %>' NavigateUrl='<%# string.Format("/Library.aspx?ct={0}&id={1}", CurrentContentType, Eval("SiteContentId")) %>' />
									<asp:Image runat="server" ID="imgContentAttach" ImageUrl="img/file_attach_16.png"
										Visible='<%# Convert.ToInt32(Eval("FileAttachements.Count")) > 0 %>' ToolTip='<%# PageHelper.GetAttachIconToolTip(Eval("FileAttachements.Count")) %>' />
									<asp:Image runat="server" ID="imgChildDocument" ImageUrl="img/document_attach_16.png"
										Visible='<%# Convert.ToInt32(Eval("ChildSiteContent.Count")) > 0 %>' ToolTip='<%# PageHelper.GetInternalDocumentsIconToolTip(Eval("ChildSiteContent.Count")) %>' />
								</h2>
								<asp:Repeater runat="server" ID="rptContentAttach" OnItemCommand="rptContentAttach_ItemCommand"
									DataSource='<%# ((SiteContent)Container.DataItem).FileAttachements %>' Visible='<%# ((SiteContent)Container.DataItem).FileAttachements.Count > 0 && String.IsNullOrEmpty(((SiteContent)Container.DataItem).Content) %>'>
									<HeaderTemplate>
										<hr />
									</HeaderTemplate>
									<ItemTemplate>
										<div class="contentAttachBlock">
											<div class="contentAttachIcon">
												<asp:LinkButton runat="server" ID="btnOpenDocumentIcon" CssClass='<%# PageHelper.GetAttachIconClass(Eval("DocumentName")) %>'
													Text='<%$ Resources:UserSite, resWhitespace %>' />
											</div>
											<div class="contentAttachFileName">
												<asp:LinkButton runat="server" ID="btnOpenDocument" Text='<%# string.Format("{0} ({1})", Eval("DocumentName"), PageHelper.GetRoundedFileSize(Eval("DocumentSize"))) %>'
													CommandName="OpenAttach" CommandArgument='<%# Eval("AttachId") %>' />
											</div>
										</div>
									</ItemTemplate>
									<FooterTemplate>
										<hr />
										<div style="clear: both;">
										</div>
									</FooterTemplate>
								</asp:Repeater>
								<p>
									<asp:Label ID="lblTeaser" runat="server" Text='<%# PageHelper.GetTeaser(Eval("Content")) %>' />
								</p>
								<div style="clear: both;">
								</div>
							</div>
						</div>
					</div>
				</ItemTemplate>
			</asp:Repeater>
			<asp:FormView runat="server" ID="fvLibrary">
				<ItemTemplate>
					<div class="post-wrapper">
						<asp:Repeater runat="server" ID="rptChildContent" DataSource='<%# ((SiteContent)Container.DataItem).ChildSiteContent %>'
							Visible='<%# ((SiteContent)Container.DataItem).ChildSiteContent.Count > 0 %>'>
							<HeaderTemplate>
								<div class="subNavButtonBlock">
							</HeaderTemplate>
							<ItemTemplate>
								<div class="subNavButton">
									<div class="subNavButtonIcon">
										<div class="subNavButtonContent">
											<asp:HyperLink runat="server" ID="hlChildContent" Text='<%# Eval("Title") %>' NavigateUrl='<%# string.Format("/Library.aspx?id={0}", Eval("SiteContentId")) %>' />
										</div>
									</div>
								</div>
							</ItemTemplate>
							<FooterTemplate>
								</div>
							</FooterTemplate>
						</asp:Repeater>
						<div class="post">
							<div class="homepost-full">
								<h2 class="pageSubTitle">
									<asp:Label ID="lblTitle" runat="server" Text='<%# Eval("Title") %>' />
								</h2>
								<asp:Repeater runat="server" ID="rptContentAttach" OnItemCommand="rptContentAttach_ItemCommand"
									DataSource='<%# ((SiteContent)Container.DataItem).FileAttachements %>' Visible='<%# ((SiteContent)Container.DataItem).FileAttachements.Count > 0 %>'>
									<HeaderTemplate>
										<hr />
									</HeaderTemplate>
									<ItemTemplate>
										<div class="contentAttachBlock">
											<div class="contentAttachIcon">
												<asp:LinkButton runat="server" ID="btnOpenDocumentIcon" CssClass='<%# PageHelper.GetAttachIconClass(Eval("DocumentName")) %>'
													Text='<%$ Resources:UserSite, resWhitespace %>' />
											</div>
											<div class="contentAttachFileName">
												<asp:LinkButton runat="server" ID="btnOpenDocument" Text='<%# string.Format("{0} ({1})", Eval("DocumentName"), PageHelper.GetRoundedFileSize(Eval("DocumentSize"))) %>'
													CommandName="OpenAttach" CommandArgument='<%# Eval("AttachId") %>' />
											</div>
										</div>
									</ItemTemplate>
									<FooterTemplate>
										<hr />
										<div style="clear: both;">
										</div>
									</FooterTemplate>
								</asp:Repeater>
								<p>
									<asp:Label ID="lblContent" runat="server" Text='<%# Eval("Content") %>' />
								</p>
								<div style="clear: both;">
								</div>
							</div>
						</div>
					</div>
				</ItemTemplate>
			</asp:FormView>
			<div class="pagination">
				<div class="alignleft">
					<a href="#">« Older Entries</a></div>
				<div class="alignright">
				</div>
			</div>
		</div>
	</div>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="cphPanel" runat="server">
	<div class="sidebar-box">
		<h2>
			<asp:Label runat="server" ID="lblLibraryListType" />
		</h2>
		<asp:MultiView runat="server" ID="mvLibraryType">
			<asp:View runat="server" ID="vCommonLibraryTypeList">
				<ul>
					<li>
						<asp:HyperLink runat="server" ID="hlJournal" NavigateUrl="/Library.aspx?ct=Journal" />
					</li>
					<li>
						<asp:HyperLink runat="server" ID="hlLection" NavigateUrl="/Library.aspx?ct=Lection" />
					</li>
					<li>
						<asp:HyperLink runat="server" ID="hlGuidline" NavigateUrl="/Library.aspx?ct=Guidline" />
					</li>
					<li>
						<asp:HyperLink runat="server" ID="hlMaterials" NavigateUrl="/Library.aspx?ct=Materials" />
					</li>
				</ul>
			</asp:View>
			<asp:View runat="server" ID="vLibraryList">
				<asp:Repeater runat="server" ID="rptLibrary">
					<HeaderTemplate>
						<ul>
					</HeaderTemplate>
					<ItemTemplate>
						<li>
							<asp:HyperLink runat="server" ID="hlLibraryType" Text='<%# Eval("Title") %>' NavigateUrl='<%# string.Format("/Library.aspx?ct={0}&id={1}", CurrentContentType, Eval("SiteContentId")) %>' />
						</li>
					</ItemTemplate>
					<FooterTemplate>
						</ul>
					</FooterTemplate>
				</asp:Repeater>
			</asp:View>
		</asp:MultiView>
	</div>
</asp:Content>
